<template>
    <div>
        <swiper :options="swiperOption">
            <swiper-slide v-for="(slide,index) in swiperSlides" :key="index" class="m-slideimg">
                <img :src="banner_url+slide.plug_ad_pic"/>
                </swiper-slide>
            <div class="swiper-pagination" slot="pagination"></div>
        </swiper>
    </div>
</template>

<script>
import {indexBanner} from '@/api/views';
export default {
    name:'',
    props:['swiperSlides'],
    data () {
        return  {
            swiperOption: {
                pagination: {
                    el: '.swiper-pagination'
                },
                autoplay:true,
                // freeMode : true,
                // loop : true,
            },
            // swiperSlides: [],
            banner_url:process.env.API_HOST,
        };
    },
    methods: {
        getIndex_ad() {
            let that = this;
            let param = {
                flag: 'index'
            }
            indexBanner(param).then((result) => {
                that.swiperSlides = result.data.data.list;
            }).catch((err) => {
                
            });
        }
    },
    mounted() {
        // this.getIndex_ad();
    }
}
</script>

<style lang="less" scoped>

</style>


